package cn.java78.springboot.myschool.service;

import cn.java78.springboot.myschool.dao.GradeDao;
import cn.java78.springboot.myschool.entity.Grade;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author oldliu
 * @since 1.0
 */
@Service
@Cacheable
@CacheConfig(cacheNames = "grade",keyGenerator = "keyg")
public class GradeService {
    @Resource
   private GradeDao mapper;
//    public Student get(long stuno){
//
//    }
//
//    public int add(Student st);
//
//
//
//    //根据学号修改信息
//    int update(Student student);
//    //根据学号删除学生
//    int del(long id);


    //按照 微信号,qq号,姓名,模糊查找学生的功能，加上分页
    public List<Grade> findALL() {

            return mapper.findALL();



    }

//    public int searchTotal( String wechat,  String qq,  String sname,  Date start,  Date end) {
//        SqlSession sqlSession = MybatisUtil.get();
//        try {
//            StudentDao mapper = sqlSession.getMapper(StudentDao.class);
//            return mapper.searchTotal(wechat, qq, sname, start, end);
//
//        } finally {
//            MybatisUtil.close(sqlSession);
//        }
//    }


}
